check_ip(){
    local ip=$1
    ping -c 3 -q "$ip" > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        echo "success"
    else
        echo "fail"
    fi
}
check_ip "$1"
